home *** CD-ROM | disk | FTP | other *** search
/ Aminet 16 / Aminet 16 (1996)(GTI - Schatztruhe)[!][Dec 1996].iso / Aminet / comm / bbs / TA1_22.lha / Programming / transamiga.h < prev   
C/C++ Source or Header  |  1994-09-10  |  5KB  |  185 lines

  1. #ifndef TRANSAMIGA_H
  2. #define TRANSAMIGA_H
  3. /*
  4. **  $Filename: transamiga.h $
  5. **  $Release: v1.12 $
  6. **  $Revision: 2.3 $
  7. **  $Date: 94/07/25 $
  8. **
  9. **  TransAmiga BBS custom library
  10. **
  11. **  (C) Copyright 1994 Sami Radwan
  12. **        All Rights Reserved
  13. */
  14.  
  15. #ifndef EXEC_TYPES_H
  16. #include <exec/types.h>
  17. #endif
  18.  
  19. #ifndef    EXEC_LIBRARIES_H
  20. #include <exec/libraries.h>
  21. #endif
  22.  
  23. #ifndef    DEVICES_SERIAL_H
  24. #include <devices/serial.h>
  25. #endif
  26.  
  27. #ifndef    GRAPHICS_SPRITE_H
  28. #include <graphics/sprite.h>
  29. #endif
  30.  
  31. #ifndef    INTUITION_INTUITION_H
  32. #include <intuition/intuition.h>
  33. #endif
  34.  
  35. #ifndef    INTUITION_SCREENS_H
  36. #include <intuition/screens.h>
  37. #endif
  38.  
  39. #define TRANSAMIGA_NAME        "transamiga.library"
  40. #define TRANSAMIGA_VERSION   0L
  41.  
  42. /* The library base structure.  At the moment, this is strictly private,
  43.  * althought some parts may be made public later on.
  44.  */
  45.  
  46. struct TransBase {
  47.     struct Library tr_Lib;
  48.     ULONG tr_SegList;
  49.     WORD tr_Sprite;
  50.     struct SimpleSprite tr_Cursor;
  51.     BOOL tr_MsgLock;
  52.     BOOL tr_FileLock;
  53.     ULONG tr_SemCount;
  54. };
  55.  
  56. /* Will eventually be filled in by SaveMsgText()
  57.  */
  58.  
  59. struct NetAddress {
  60.     UWORD na_Zone;
  61.     UWORD na_Net;
  62.     UWORD na_Node;
  63.     UWORD na_Point;
  64.     UWORD na_PointNet;
  65.     UBYTE na_Domain[20];
  66. };
  67.  
  68. #define ATTR_PRIV 1L
  69. #define ATTR_CRASH 2L
  70. #define ATTR_RECEIVED 4L
  71. #define ATTR_FATTACH 16L
  72. #define ATTR_KILL 128L
  73. #define ATTR_HOLD 512L
  74.  
  75. struct MsgHeader {
  76.     UBYTE mh_FromUser[36];
  77.     UBYTE mh_ToUser[36];
  78.     UBYTE mh_Subject[72];
  79.     UBYTE mh_DateTime[20];
  80.     UBYTE mh_MsgID[30];
  81.     struct NetAddress mh_OrigNode;
  82.     struct NetAddress mh_DestNode;
  83.     LONG mh_Attrs;
  84.     LONG mh_PrevReply;
  85.     LONG mh_NextReply;
  86. };
  87.  
  88. /* Message mode values for SaveMsgText()
  89.  */
  90.  
  91. #define QUOTE_TYPE        1L                /* Message text should be displayed in quoted form */
  92. #define ASCII_TYPE        2L                /* Normal display with no ANSI */
  93. #define ANSI_TYPE        4L                /* Normal display with ANSI */
  94. #define SHOW_KLUDGE        8L                /* Display kludge lines */
  95. #define TEXTONLY_TYPE  16L                    /* Show body only, no header or threading */
  96.  
  97. /* This is strictly private, DO NOT USE IT!
  98.  */
  99.  
  100. struct ANSITerminal {
  101.     UWORD at_FColour;
  102.     UWORD at_BColour;
  103.     WORD at_X,at_Y;
  104.     WORD at_SX,at_SY;
  105.     ULONG at_Style;                        /* PRIVATE */
  106.     UWORD at_Flag;                        /* PRIVATE */
  107.     UWORD at_Values[3];                    /* PRIVATE */
  108.     UWORD at_Bright;                    /* PRIVATE */
  109.     UWORD at_ValPtr;                    /* PRIVATE */
  110.     BOOL at_InANSI;                        /* PRIVATE */
  111.     UBYTE at_Work[90];
  112. };
  113.  
  114. /* This is the meat and potatoes.  Be careful, as there is a mixture of
  115.  * public fields, read-only fields, and private fields.  If you are
  116.  * starting up a new line, then you must set the bl_Number and bl_Window
  117.  * fields, and optionally bl_SerDev, bl_SerUnit, bl_Screen, bl_Planes,
  118.  * bl_Name, bl_Status, bl_Message, bl_FontName and bl_FontSize, BEFORE you
  119.  * call NewBBSLine().  You may only change the bl_Status and bl_Comment
  120.  * fields after this has been called, or if you recieved this structure with
  121.  * BBSLineInfo().  You can also change bl_CallerType, but under normal
  122.  * circumstances, only the programme that created the line should do so.
  123.  */
  124.  
  125. struct BBSLine {
  126.     ULONG bl_Number;                    /* The number associated with this line */
  127.     char *bl_Name;                        /* The "name" of the user of this line */
  128.     char *bl_Status;                    /* Current status of this line */
  129.     char *bl_Message;                    /* PRIVATE */
  130.     ULONG bl_SerUnit;                    /* Serial device unit */
  131.     char *bl_SerDev;                    /* Serial device name, NULL for no serial I/O */
  132.     struct IOExtSer *bl_SerRead;                /* Serial I/O read request */
  133.     struct IOExtSer *bl_SerWrite;                /* Serial I/O write request */
  134.     struct IOStdReq *bl_ConRead;                /* Console I/O read request */
  135.     struct IOStdReq *bl_ConWrite;                /* Console I/O write request */
  136.     struct Window *bl_Window;                /* Window for console output */
  137.     struct Screen *bl_Screen;                /* Custom screen used (optional) */
  138.     struct SignalSemaphore *bl_UserSem;            /* PRIVATE */
  139.     struct SignalSemaphore *bl_MsgPSem;            /* PRIVATE */
  140.     char *bl_FontName;                    /* The name of the font to use */
  141.     ULONG bl_FontSize;                    /* The size of the font to use */
  142.     struct TextFont *bl_TextFont;                /* Of the font in the window */
  143.     BYTE bl_SReadOpen;                    /* PRIVATE */
  144.     BYTE bl_SWriteOpen;                    /* PRIVATE */
  145.     struct SignalSemaphore *bl_FileSem;            /* PRIVATE */
  146.     struct SignalSemaphore *bl_CallerSem;            /* PRIVATE */
  147.     struct SignalSemaphore *bl_LReadSem;            /* PRIVATE */
  148.     BOOL bl_ConPending;                    /* PRIVATE */
  149.     struct BBSLine *bl_OtherLine;                /* PRIVATE */
  150.     ULONG bl_Nothing;                    /* PRIVATE */
  151.     WORD bl_Planes;                        /* If you set bl_Screen, SET THIS! */
  152.     WORD bl_Sprite;                        /* PRIVATE */
  153.     struct SimpleSprite bl_Cursor;                /* PRIVATE */
  154.     struct ANSITerminal bl_Term;                /* PRIVATE */
  155.     BOOL bl_ReceiveMsgs;                    /* Willing to receive node messages */
  156.     ULONG number;                        /* PRIVATE */
  157.     BOOL bl_DisplayStatus;                    /* local display status */
  158.     BOOL bl_CarrierCheck;                    /* CarrierCheck allowed? TRUE=Yes */
  159.     ULONG bl_Expansion[56];                    /* Lots of room for expansion */
  160. };
  161.  
  162. /* Error values returned by NewBBSLine() and ObtainLine()
  163.  */
  164.  
  165. #define ERR_LINEINUSE 1
  166. #define ERR_NOREADPORT 2
  167. #define ERR_NOREADIO 3
  168. #define ERR_NOSERDEVREAD 4
  169. #define ERR_NOWRITEPORT 2
  170. #define ERR_NOWRITEIO 3
  171. #define ERR_NOSERDEVWRITE 4
  172. #define ERR_NOWINDOW 5
  173. #define ERR_NOCONPORT 6
  174. #define ERR_NOCONIO 7
  175. #define ERR_NOCONDEV 8
  176. #define ERR_LINENOTFOUND 9
  177. #define ERR_SERDEVLOCKED 10
  178.  
  179. /* Values passed to CheckLock()
  180.  */
  181. #define MSGAREAS 1
  182. #define FILEAREAS 2
  183.  
  184. #endif
  185.